﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
namespace BLL.Sec
{
    /// <summary>
    /// 登录日志类，日志存在数据库SEC_LOGONLOG表中
    /// </summary>
    public class LogonLog
    {
        private readonly OracleDAL.Sec.LogonLog dal = new OracleDAL.Sec.LogonLog();
        /// <summary>
        /// 写登录日志
        /// </summary>
        /// <param name="log">登录日志对象</param>
        /// <returns>写入日志是否成功</returns>
        public bool WriteLog(Model.Sec.LogonLog log)
        {
            return dal.WriteLog(log);
        }
        /// <summary>
        /// 删除登录记录
        /// </summary>
        /// <param name="strWhere">条件</param>
        /// <returns></returns>
        public bool Delete(string strWhere)
        {
            return dal.Delete(strWhere);
        }
        /// <summary>
        /// 根据条件获得登录记录集
        /// </summary>
        /// <param name="strWhere">条件,可以为空</param>
        /// <returns></returns>
        public DataTable GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }
        /// <summary>
        /// 写入登录日志 
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Add(Model.Sec.LogonLog model)
        {
            return dal.Add(model);
        }
        /// <summary>
        /// 更新登录日志退出时间,退出时间就是执行时间
        /// </summary>
        /// <param name="logISN"></param> 
        /// <returns></returns>
        public bool Update(string logISN)
        {
            return dal.Update(logISN);
        }
    }

}
